import { createSlice } from '@reduxjs/toolkit'

export const CitySlice = createSlice({
  name: 'CitySlice',
  initialState: {
      start: '北京',
      end:'广州'
  },
  reducers: {
      dj(state, { payload: { type, city } })
      {
          state[type]=city
      }
  },
})

// Action creators are generated for each case reducer function
export const { dj } = CitySlice.actions

export default CitySlice.reducer